//
//  YDOAFuncVC.swift
//  YDOAProduct
//
//  Created by YDWY on 2017/5/26.
//  Copyright © 2017年 Allen. All rights reserved.
//

import UIKit
import Toaster


class YDOAFuncVC: UIViewController {

    
    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        self.navigationController?.navigationBar.isHidden = true

    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        // self.navigationController?.navigationBar.isHidden = true
    }
    
    
    override func viewDidLoad() {
        
        super.viewDidLoad()
               // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    //返回
    @IBAction func goback(_ sender: Any) {
        self.dismiss(animated: true) { 
            
        }
    }
    //退出
    @IBAction func exit(_ sender: Any) {
//        self.present(YDOALoginVC(), animated: true) { 
//            
//        }
        
        self.dismiss(animated: true) {
            
        }
    }
    
    //管理按钮点击
    @IBAction func btnclick(_ sender: UIButton) {
        
        switch sender.tag  {
            //待审批事项
        case 10001:
            YMLog.log(item: "审批事项")
            let backItem = UIBarButtonItem()
            backItem.title = ""
            //self.navigationItem.backBarButtonItem = backItem
            //MARK: - 修改审核界面
//            navigationController?.pushViewController(YDOAStaycheckVC(), animated: true)
            let layout = UICollectionViewFlowLayout();
            layout.itemSize = CGSize(width:(UIScreen.ym_screenWidth()-20)/3 ,height: 100);
            layout.minimumInteritemSpacing = 10
            layout.minimumLineSpacing = 10; navigationController?.pushViewController(
                YDOAApprovalVC(collectionViewLayout: layout), animated: true)
            break
        //固定资产设置
        case 10002:
             YMLog.log(item: "固定资产设置")
             let backItem = UIBarButtonItem()
             backItem.title = ""
             //self.navigationItem.backBarButtonItem = backItem
             navigationController?.pushViewController(YDOAProChangeVC(), animated: true)
            break
        //申请管理
        case 10003:
             YMLog.log(item: "申请管理")
             let backItem = UIBarButtonItem()
             backItem.title = ""
             //self.navigationItem.backBarButtonItem = backItem
//  关闭之前写的界面           navigationController?.pushViewController( YDOAApplyVC(), animated: true)
             
            navigationController?.pushViewController(YDOAApplyManageVC(), animated: true)
            break
        //工作餐管理
        case 10004:
            YMLog.log(item: "工作餐管理")

            let backItem = UIBarButtonItem()
            backItem.title = ""
            //self.navigationItem.backBarButtonItem = backItem
            navigationController?.pushViewController(YDOAWoringLunchManVC(), animated: true)
            
            
            break
        //公告管理
        case 10005:
             YMLog.log(item: "公告管理")
             let backItem = UIBarButtonItem()
             backItem.title = ""
             //self.navigationItem.backBarButtonItem = backItem
             navigationController?.pushViewController(YDOANoticeManVC(), animated: true)
            break
        //车辆管理
        case 10006:
             YMLog.log(item: "库存管理")
             let backItem = UIBarButtonItem()
             backItem.title = ""
             //之前的车辆管理 放这里没删除
//             navigationController?.pushViewController(YDOACatManagerVC(), animated: true)
             navigationController?.pushViewController(YDOAInventoryManageVC(), animated: true)
             

            break
        //预算管理
        case 10007:
            YMLog.log(item: "我的申请")
              navigationController?.pushViewController(YDOAMyApplyVC(), animated: true)
            
            break
        default:break
            
        }
        
    }
    
    
  

    
    
    
   
}
